/*
 * @(#)UserController.java
 *
 *
 */

package com.example.mall.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

/**
 * UrlController
 * Created on 2023/12/27.
 */
@Api(tags = "UrlController", description = "页面管理")
@Controller
@RequestMapping("/url")
public class UrlController {

    @ApiOperation("首页")
    @RequestMapping(value = "index", method = RequestMethod.GET)
    public String index(Model model) {
        return "index";
    }

    @ApiOperation("登录页")
    @RequestMapping(value = "login", method = RequestMethod.GET)
    public String login() {
        return "page-login";
    }

    @ApiOperation("注册页")
    @RequestMapping(value = "register", method = RequestMethod.GET)
    public String register() {
        return "page-register";
    }

    @ApiOperation("我的信息页面")
    @RequestMapping(value = "info", method = RequestMethod.GET)
    public String info(Model model) {
        return "page-account";
    }

    @ApiOperation("购物车页面")
    @RequestMapping(value = "cart", method = RequestMethod.GET)
    public String cart(Model model) {
        return "shop-cart";
    }

    @ApiOperation("商品总览页")
    @RequestMapping(value = "prolist", method = RequestMethod.GET)
    public String listPage(Model model, Integer pageNum) {
        return "shop-fullwidth";
    }

    @ApiOperation("商品检索")
    @RequestMapping(value = "prolist/search", method = RequestMethod.GET)
    public String listPageSearch(Model model, String keyword, Integer pageNum, boolean initFlg) {
        return "shop-fullwidth";
    }

    @ApiOperation("商品详情页")
    @RequestMapping(value = "prodetail/{id}", method = RequestMethod.GET)
    public String detail(Model model, @PathVariable("id") String proid) {
        return "shop-product-full";
    }

    @ApiOperation("订单详细页面")
    @RequestMapping(value = "orderdetail/{id}", method = RequestMethod.GET)
    public String orderdetail(Model model, @PathVariable("id") String orderid) {
        return "order-detail";
    }

    @ApiOperation("评价页面")
    @RequestMapping(value = "review/{id}", method = RequestMethod.GET)
    public String review(Model model, @PathVariable("id") String orderitemid) {
        return "review";
    }

    @ApiOperation("结算页面")
    @RequestMapping(value = "checkout", method = RequestMethod.GET)
    public String checkout(Model model) {
        return "shop-checkout";
    }

    @ApiOperation("错误")
    @RequestMapping(value = "error", method = RequestMethod.GET)
    public String error() {
        return "page-404";
    }

    @ApiOperation("商品管理")
    @RequestMapping(value = "promanage", method = RequestMethod.GET)
    public String promanage(Model model) {
        return "manage-product";
    }

    @ApiOperation("商品管理详细")
    @RequestMapping(value = "promanage/detail", method = RequestMethod.GET)
    public String promanageDetail(Model model, String id) {
        return "manage-product-detail";
    }

    @ApiOperation("用户管理")
    @RequestMapping(value = "usermanage", method = RequestMethod.GET)
    public String usermanage(Model model) {
        return "manage-user";
    }

    @ApiOperation("用户管理详细")
    @RequestMapping(value = "usermanage/detail", method = RequestMethod.GET)
    public String usermanageDetail(Model model, String id) {
        return "manage-user-detail";
    }

    @ApiOperation("订单管理")
    @RequestMapping(value = "ordermanage", method = RequestMethod.GET)
    public String ordermanage(Model model) {
        return "manage-order";
    }

    @ApiOperation("订单管理详细")
    @RequestMapping(value = "ordermanage/detail", method = RequestMethod.GET)
    public String ordermanageDetail(Model model, String id) {
        return "manage-order-detail";
    }

}
